<template>
  <div class="cont">
    <div class="fx-1">
      <span class="title">掌柜利润</span>
      <span class="date">查询时间:{{$utils.toTimeFormat(date,'yyyy年MM月dd日 hh时mm分ss秒')}}</span>
      <el-button type="text" @click="refresh"><i class="iconfont icon-shuaxin"></i></el-button>
    </div>
    <v-private-item label="累计利润" :value="wallet.totalAmount"/>
    <v-private-item label="当日利润" :value="wallet.dayAmount"/>
  </div>
</template>

<script lang="ts">
  import { Vue, Component, Prop } from 'vue-property-decorator'
  import vTitle from '../home-title'
  import vPrivateItem from '../private-item'
  @Component({
    components: {
      vTitle,vPrivateItem
    }
  })
  export default class Store extends Vue {
    @Prop({
      default: () => {}
    }) wallet
    date = +new Date()

    refresh () {
      this.$emit('refresh')
      this.date = + new Date()
    }
  }
</script>

<style lang="less" scoped>
  .cont {
    height: 114px;
    display: flex;
    padding-bottom: 20px;
  }

  .title {
    font-size: 20px;
    color: #666;
    margin: 20px auto 40px;
    padding-left: 20px;
  }

  .date {
    color: #999;
  }
</style>
